package com.lanxiao.cloud.common.mybatis.basic;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;

/**
 * @author ：qiaoliang
 * @date ：2021-08-19
 */
public class Entity<T> implements Serializable {
  @TableId(type = IdType.AUTO)
  private T id;

  @TableField(fill = FieldFill.INSERT)
  private Date createTime;

  @TableField(fill = FieldFill.UPDATE)
  private Date updateTime;

  public Entity() {
  }

  public Entity(T id) {
    this.id = id;
  }

  public Entity(T id, Date createTime, Date updateTime) {
    this.id = id;
    this.createTime = createTime;
    this.updateTime = updateTime;
  }

  public void setId(T id) {
    this.id = id;
  }

  public T getId() {
    return id;
  }

  public Date getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  public Date getUpdateTime() {
    return updateTime;
  }

  public void setUpdateTime(Date updateTime) {
    this.updateTime = updateTime;
  }
}
